package com.seal.yoyoshop.adminweb;

import com.seal.yoyoshop.bin.Type;
import com.seal.yoyoshop.service.TypeService;
import com.seal.yoyoshop.service.impl.TypeServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "TypeListServlet", value = "/admin/typeList")
public class TypeListServlet extends HttpServlet {

    private TypeService typeService = new TypeServiceImpl();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setAttribute("flag",4);

        List<Type> typeList = typeService.getTypeList();
        request.setAttribute("typeList",typeList);

        request.getRequestDispatcher("/admin/type_list.jsp").forward(request,response);
    }

}
